# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: DonVla <donvla/users.sourceforge/net>
# Contributor: Hervé Cauwelier <herve/oursours/net>

pkgname=python-xapian
_name=xapian-bindings
pkgver=1.4.23
pkgrel=1
epoch=1
pkgdesc="Python bindings for Xapian"
arch=(loong64 x86_64)
url="https://xapian.org/docs/bindings/python/"
license=(GPL2)
depends=(
  gcc-libs
  glibc
  python
  zlib
)
makedepends=(
  util-linux-libs
  python-sphinx
  "xapian-core=$epoch:$pkgver"
)
source=(https://oligarchy.co.uk/xapian/$pkgver/$_name-$pkgver.tar.xz{,.asc})
sha512sums=('25ac17baf1f288dedce70b983cba294d4ce100f6f5b607c76f5b697c04f6b08c276a55ccd5b9cc9c429664e1bb86f0fc31d88c72481a9cc951942efdfa9726a2'
            'SKIP')
b2sums=('521563f86d3be88458cee220065cbdbf27633f87535b1702c8c3484860533dc9395060c72582420e32b854601c1ee1eb424e03a9251965215de834f2b130b154'
        'SKIP')
validpgpkeys=('08E2400FF7FE8FEDE3ACB52818147B073BAD2B07') # Olly Betts <olly@debian.org>

prepare() {
  cd $_name-$pkgver
  autoreconf -fiv
}

build() {
  cd $_name-$pkgver
  ./configure --prefix=/usr --with-python3
  make
}

check() {
  cd $_name-$pkgver
  make check
}

package() {
  depends+=(
    util-linux-libs libuuid.so
    xapian-core libxapian.so
  )

  cd $_name-$pkgver
  make DESTDIR="$pkgdir" install
  install -vDm 644 {AUTHORS,ChangeLog,HACKING,NEWS,README,TODO} -t "$pkgdir/usr/share/doc/$_name"
}
# vim:set ts=2 sw=2 et:
